<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var arr1 = [34,12,657,87,67,78];
    var arr2 = [56,32,98,213,897,54];
    var num = arr1.concat(arr2);
    var len = num.length-1
    // [34,12,657,87,67,78,56,32,98,213,897,54]
    for( var i = 0; i < len; i++){
				for( var j = 0; j < len - i; j++){
					if(num[j]>num[j+1]){
						var a = num[j];
						num[j] = num[j+1];
						num[j+1] = a;
				}
			}
		}
    document.write('排序后：'+ num);
  </script>
</body>
</html>